#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <QTime>
#include <errno.h>
#include <QMouseEvent>


#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include "data.h"
#include "socket.h"
#include "convertformat.h"
#include "decode.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void connectServer();
    int displayPicture();
    void unconnect();
    void controlSet();
    void controlClean();
    void process();

signals:
    void recvReady();

private:
    Ui::MainWindow *ui;
    QImage *img;
    Data::DataPtr data_;
    Socket::SocketPtr socket_;
    Decode::DecodePtr decode_;
    boost::shared_ptr<ConvertFormat> convert, convert2;

    bool isRuning;
    void InitSignal();
    void InitDisplay();

    QPoint windowPos;
    QPoint mousePos;
    QPoint dPos;

protected:
//    void mousePressEvent(QMouseEvent *e);
//    void mouseMoveEvent(QMouseEvent *e);

};

#endif // MAINWINDOW_H
